<form action="{:U('arctype/add')}" method='post' class="form-horizontal" role="form">
    <div class="form-group">
        <label class="col-sm-2 control-label">上级栏目</label>
        <div class="col-sm-4">
            <select class="form-control" name="pid">
                <option value="0" <if condition="$parentid eq 0">selected=selected</if>>--无--</option>
                <volist name="categroy" id="vo">
                    <option value="{$vo['id']}" <if condition="$parentid eq $vo['id']"> selected=selected</if>>
                    <for start="1" end="$vo['level']">
                        &nbsp;&nbsp;&nbsp;
                    </for>
                    <if condition="$vo['level'] neq 1">
                        └─&nbsp;
                    </if>
                    {$vo['title']}
                    </option>
                </volist>
            </select>
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-2 control-label">栏目名称</label>
        <div class="col-sm-4">
            <input type="text" name="title" value="" class="form-control" />
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-2 control-label">网页标题</label>
        <div class="col-sm-4">
            <input type="text" name="meta_title" value="" class="form-control" />
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-2 control-label">关键字</label>
        <div class="col-sm-4">
            <input type="text" name="keywords" value="" class="form-control" />
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-2 control-label">栏目描述</label>
        <div class="col-sm-4">
            <textarea name="description" class="form-control" rows="3"></textarea>
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-2 control-label">栏目图片</label>
        <div class="col-sm-4">
            <label>
                <input type="text" id="url1" name="icon" value="" class="form-control" />
            </label>
            <label>
                <input type="button" id="image1" value="浏览" class="btn" />
            </label>
            <p><img src="__PUBLIC__/images/default.gif" id="imgurl" class="img-rounded" style="max-width: 300px;max-height: 100px;" /></p>
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-2 control-label">选择模型</label>
        <div class="col-sm-4">
            <select class="form-control" name="model">
                <volist name="mlist" id="vo">
                    <option value="{$vo['id']}">{$vo['name']}</option>
                </volist>
            </select>
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-2 control-label">栏目模板</label>
        <div class="col-sm-4">
            <select class="form-control" name="template_lists">
                <option value="0">--请选择--</option>
                <volist name="tmplist" id="vo">
                    <option value="{$key}">{$vo}</option>
                </volist>
            </select>
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-2 control-label">内容模板</label>
        <div class="col-sm-4">
            <select class="form-control" name="template_detail">
                <option value="0">--请选择--</option>
                <volist name="cntlist" id="vo">
                    <option value="{$key}">{$vo}</option>
                </volist>
            </select>
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-2 control-label">状态</label>
        <div class="col-sm-4">
            <label class="radio-inline">
                <input type="radio" name="status" id="status" value="0" checked> 显示
            </label>
            <label class="radio-inline">
                <input type="radio" name="status" id="status" value="1"> 不显示
            </label>
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-2 control-label"></label>
        <div class="col-sm-4">
            <button class="btn btn-primary" type="submit">提交</button>
            <button class="btn btn-primary" type="button" onclick="history.go(-1)">返回</button>
        </div>
    </div>
</form>

<!--上传图片js -->
<script>
    KindEditor.ready(function(K) {
        var editor = K.editor({
            allowFileManager : true
        });
        K('#image1').click(function() {
            editor.loadPlugin('image', function() {
                editor.plugin.imageDialog({
                    imageUrl : K('#url1').val(),
                    clickFn : function(url, title, width, height, border, align) {
                        K('#url1').val(url);
                        K('#imgurl').attr("src",url);
                        editor.hideDialog();
                    }
                });
            });
        });
    });
</script>